<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    <title>个人成就</title>
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current bg-light-gray">
        
        <nav class="bar bar-tab punch-card-bar">
          <c:set var="monthlyCourseware" value="${persist.monthlyCourseware(user.id)}"/>
          <a class="tab-item external" href="${ctx.host}/courses/${monthlyCourseware.id}/batches/${persist.batchCourseware(monthlyCourseware.id).id}/units">
            <span class="icon icon-today"></span>
            <span class="tab-label">今日</span>
          </a>
          <a class="tab-item external" href="${ctx.host}/courses">
            <span class="icon icon-lesson"></span>
            <span class="tab-label">课程</span>
          </a>
          <a class="tab-item external active" href="${ctx.host}/profile">
            <span class="icon icon-profile"></span>
            <span class="tab-label">我的</span>
          </a>
        </nav>

        <div class="content">
          <div class="achievement-wrap box-shadow">
              <div class="row">
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['three_day'] && achievements['three_day'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-three-days-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-three-days.png" width="100%">
                        <c:if test="${not empty achievements['three_day'] && achievements['three_day'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['three_day'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['one_week'] && achievements['one_week'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-one-week-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-one-week.png" width="100%">
                        <c:if test="${not empty achievements['one_week'] && achievements['one_week'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['one_week'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['one_month'] && achievements['one_month'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-one-months-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-one-months.png" width="100%">
                        <c:if test="${not empty achievements['one_month'] && achievements['one_month'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['one_month'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['two_month'] && achievements['two_month'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-two-months-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-two-months.png" width="100%">
                        <c:if test="${not empty achievements['two_month'] && achievements['two_month'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['two_month'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['three_month'] && achievements['three_month'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-three-months-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-three-months.png" width="100%">
                        <c:if test="${not empty achievements['three_month'] && achievements['three_month'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['three_month'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
                <div class="col-50">
                  <div class="achievement-item active">
                    <c:choose>
                      <c:when test="${not empty achievements['four_month'] && achievements['four_month'].status.received}">
                        <img src="${ctx.resource}/image/achievement/achievement-four-months-hover.png" width="100%">
                      </c:when>
                      <c:otherwise>
                        <img src="${ctx.resource}/image/achievement/achievement-four-months.png" width="100%">
                        <c:if test="${not empty achievements['four_month'] && achievements['four_month'].status.receiving}">
                          <a href="javascript:void(0);" class="receive" data-achievement="${achievements['four_month'].id}">可领取</a>
                        </c:if>
                      </c:otherwise>
                    </c:choose>
                  </div>
                </div>
              </div>
          </div>
          
        </div>
        
      </div>
    </div>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource root="${ctx.resource}/build" type="script" src="js/page/profile/profile-achievement.js" />
    <script type="text/javascript">
      require(['page/profile/profile-achievement'], function(page) {
        page.init()
      })
    </script>
  </body>
</html>